import request from '@/utils/request'
// 素材计数
export function status(msgId) {
  return request({
    url: '/admin/wx.broadcast/status',
    method: 'GET',
    params: {
      msg_id: msgId
    }
  })
}
export function preview(mediaId, wxname, type) {
  return request({
    url: '/admin/wx.broadcast/preview',
    method: 'POST',
    data: {
      media_id: mediaId,
      wxname: wxname,
      type: type
    }
  })
}
export function fetchList (query) {
  return request({
    url: '/admin/wx.broadcast/index',
    method: 'GET',
    params: query
  })
}
export function fetchOne (id) {
  return request({
    url: '/admin/wx.broadcast/read',
    method: 'GET',
    params: {
      id
    }
  })
}
export function updateOne(data) {
  return request({
    url: '/admin/wx.broadcast/update',
    method: 'PUT',
    data
  })
}
export function createOne(data) {
  return request({
    url: '/admin/wx.broadcast/save',
    method: 'POST',
    data
  })
}
export function deleteOne(id) {
  return request({
    url: '/admin/wx.broadcast/delete',
    method: 'DELETE',
    params: {
      id
    }
  })
}
